#ifndef QUERYRESULT_H
#define QUERYRESULT_H

#include <memory>
#include <string>
#include <vector>
#include <set>
#include <iostream>

class QueryResult
{
    friend std::ostream& print(std::ostream&, const QueryResult&);
public:
    typedef std::vector<std::string>::size_type line_no;
    typedef std::set<line_no>::const_iterator line_iter;
    QueryResult(std::string,
                std::shared_ptr<std::set<line_no> >,
                std::shared_ptr<std::vector<std::string> >);            
    std::set<line_no>::size_type size() const;
    line_iter begin() const;
    line_iter end() const;
    std::shared_ptr<std::vector<std::string> > get_file();
private:
    std::string sought;
    std::shared_ptr<std::set<line_no> > lines;
    std::shared_ptr<std::vector<std::string> > file;
};

std::ostream& print(std::ostream&, const QueryResult&);
#endif